﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Areas/Manage/Views/Shared/Master.Master"
    Inherits="System.Web.Mvc.ViewPage<OrderViewModel>" %>
<%@ Import Namespace="xTeam.Hengle.Helper" %>
<asp:Content ID="Content1" ContentPlaceHolderID="MainContent" runat="server">
    <table class="orderView gv">
        <thead>
            <tr>
                <td colspan="6">
                    订单信息
                </td>
            </tr>
        </thead>
        <tbody>
            <tr>
                <td class="textRight width80">
                    编号:
                </td>
                <td>
                    <%= Model.OrderView.OrderId %>
                </td>
                <td class="textRight width80">
                    总件数:
                </td>
                <td>
                    <%= Model.OrderView.Count %>
                </td>
                <td class="textRight width80">
                    总金额
                </td>
                <td class="colorRed fontBold">
                    <%= Model.OrderView.Price.ToString("0.00") %>
                </td>
            </tr>
            <tr>
                <td class="textRight">
                    订单状态:
                </td>
                <td colspan="5">
                    <%= StringExtendFun.OrderStateForManage(Model.OrderView.State)%>
                </td>
            </tr>
            <tr>
                <td class="textRight">
                    备注:
                </td>
                <td colspan="5">
                    <%= Model.OrderView.Description %>
                </td>
            </tr>
            <tr>
                <td class="textRight">
                    生成日期:
                </td>
                <td>
                    <%= Model.OrderView.AddDate %>
                </td>
                <td>
                </td>
                <td>
                </td>
                <td>
                </td>
                <td class="width100">
                    <%= string.Format("<div class='orderState orderState_{0}'></div>",Model.OrderView.State) %>
                </td>
            </tr>
        </tbody>
    </table>
    <ul class="setpBySetp">
        <li>&nbsp;</li>
        <li><a href="#pl">商品列表</a></li>
        <li><a href="#si">收货信息</a></li>
        <li><a>会员信息</a></li>
        <li><a href="#process">订单处理</a></li>
    </ul>
    <table class="orderView gv" id="pl">
        <thead>
            <tr class="textCenter">
                <td class="textLeft">
                    商品名称
                </td>
                <td>
                    数量
                </td>
                <td>
                    零售价
                </td>
                <td>
                    折扣率
                </td>
                <td>
                    折扣价
                </td>
                <td>
                    合计
                </td>
            </tr>
        </thead>
        <tbody class="textCenter">
            <% foreach (EProduct item in Model.ProductList)
               {
            %>
            <tr>
                <td class="textLeft">
                    <%=Html.ActionLink(item.ProductName, "PreView", "Product", new { ProductId = item.ProductId }, new { target="_blank"})%>
                    <span class="font12 colorGray">
                        <%= item.Description.Replace("\n","&nbsp;") %></span>
                </td>
                <td>
                    <%= item.SalesCount %>
                </td>
                <td>
                    <%= item.Price %>
                </td>
                <td>
                    <%= item.DisCount.ToString("0.00") %>
                </td>
                <td>
                    <%= ((decimal)item.DisCount * item.Price).ToString("0.00") %>
                </td>
                <td>
                    <%= (item.SalesCount * (decimal)item.DisCount * item.Price).ToString("0.00") %>
                </td>
            </tr>
            <%   
               } 
            %>
        </tbody>
    </table>
    <table class="orderView gv" id="si">
        <thead>
            <tr>
                <td colspan="2">
                    收货人信息
                </td>
            </tr>
        </thead>
        <tbody>
            <tr>
                <td class="width80 textRight">
                    姓名:
                </td>
                <td>
                    <%= Model.Address.ReallyName %>
                </td>
            </tr>
            <tr>
                <td class="textRight">
                    地址:
                </td>
                <td>
                    <%= Model.Address.Address %>
                </td>
            </tr>
            <tr>
                <td class="textRight">
                    邮编:
                </td>
                <td>
                    <%= Model.Address.PostNo %>
                </td>
            </tr>
            <tr>
                <td class="textRight">
                    电话:
                </td>
                <td>
                    <%= Model.Address.Phone %>
                </td>
            </tr>
            <tr>
                <td class="textRight">
                    手机:
                </td>
                <td>
                    <%= Model.Address.Mobile %>
                </td>
            </tr>
            <tr>
                <td class="textRight">
                    备注:
                </td>
                <td>
                    <%= Model.Address.Description %>
                </td>
            </tr>
        </tbody>
    </table>
    <form method="post" action="<%=Url.Action("SaleProcess") %>" id="process">
    <table class="orderView gv">
        <thead>
            <tr>
                <td colspan="2">
                    订单处理
                </td>
            </tr>
        </thead>
        <tbody>
            <tr>
                <td class="width80 textRight">
                    修改状态
                </td>
                <td>
                <%=CustomerControl.OrderStateSelect(Model.OrderView.State, "state", "state")%>
                </td>
            </tr>
            <tr>
                <td class="textRight">
                    快递编号:
                </td>
                <td>
                    <%= Html.TextBox("ExpressNo", Model.Express.ExpressNo) %>
                </td>
            </tr>
            <tr>
                <td class="textRight">
                    发货说明:
                </td>
                <td>
                    <%=Html.TextArea("Description" , Model.Express.Description , new {rows="5" ,cols="50",@class="Width150"})%>
                </td>
            </tr>
            <tr>
                <td>
                </td>
                <td>
                    <%= Html.Hidden("Uid" , Model.OrderView.Uid)%>
                    <%= Html.Hidden("OrderId",Model.OrderView.OrderId) %>
                    <input type="submit" value="修改状态" />
                </td>
            </tr>
        </tbody>
    </table>
    </form>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="head" runat="server">
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="cssLink" runat="server">
</asp:Content>
<asp:Content ID="Content4" ContentPlaceHolderID="jsLink" runat="server">
    <script src="<%=Url.Content("~/Scripts/Common/ui.tabs.min.js") %>" type="text/javascript"></script>
    <script src="<%=Url.Content("~/Scripts/Manage/Order.js") %>" type="text/javascript"></script>
</asp:Content>
<asp:Content ID="Content5" ContentPlaceHolderID="cssContent" runat="server">
</asp:Content>
<asp:Content ID="Content6" ContentPlaceHolderID="jsContent" runat="server">
    <script type="text/javascript">
        $(function () {
            OrderView.ProcessUrl = '<%=Url.Action("SaleView",new {OrderId=Model.OrderView.OrderId,Uid=Model.OrderView.Uid}) %>'
            OrderView.Init();
        });
    </script>
</asp:Content>
